<?php
header("Content-Type: text/html; charset=utf-8");
$username="eu_wilhelm";
$password="n3DN67xcDwPyba4S";
$database="eu_wilhelm";

$sessionID = $_GET['sessionID'];

mysql_connect("gis-db.uni-muenster.de",$username,$password) or die("Connection failed: ". mysql_error());

@mysql_select_db($database) or die( "Unable to select database: ". mysql_error());

if($sessionID == ""){
	$query="SELECT * FROM storyLogger";
}
else{
	$query="SELECT * FROM storyLogger WHERE sessionID = $sessionID";
}

$result=mysql_query($query);

print("point" . "\t" . "title" . "\t" . "description" . "\t" . "icon \n");



while($row = mysql_fetch_row($result))
	{
	//sessionID, lat, lon, chapter, city, street, pub, cafe, restaurant, train, area, weather, page
	$x = $row[3];
	$y = $row[2];
	$title = $row[13];
	//$descrip = "Kapitel: ".$row[12]. " Stadt: ".$row[4]. " Straße: ".$row[5]. " Pub: ".$row[6]. " Cafe: ".$row[7]. " Restaurant: ".$row[8]. " Wetter: ".$row[9]. " Bahnhof=".$row[10]. " Bereich:".$row[11]. " Datum: ".$row[14];
	$descrip = "Kapitel: ".$row[12]. " Stadt: ".$row[4]. " Straße: ".$row[5]. " Bereich:".$row[11]. " Seite: ".$row[13]." Datum: ".$row[14];
	print("$y,$x" . "\t" . "Seite: $title" . "\t" . "$descrip" . "\t" . "" . "\n");
	}
mysql_free_result($result);

?>